Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 4.0.0
The latest stable release of ink! is here 🥳
This version brings a lot of usability improvements, making the language better suited for the needs of production parachains.
A couple of highlights include:
contract binaries
There's a lot more to dig through, so take some time to poke around the
CHANGELOG
(including the4.0.0-alpha
and4.0.0-beta
releases).You may notice there have been a few breaking changes. No need to be scared though, we wrote up a migration guide covering all of the breaking changes and how to update your ink! 3.x contract accordingly.
Thanks to everyone that helped make this release possible ❤️
Compatibility
In order to build contracts which use ink!
v4.0.0
you need to usecargo-contract
v2.0.0
. You can install it as follows:cargo install cargo-contract --forced --locked
You will also need to use a version of
pallet-contracts
later than polkadot-v0.9.37 in your node.The
v0.24.0
release of thesubstrate-contracts-node
is compatible with the ink!4.0.0
release.For full compatibility requirements see the migration guide.
Added
Mapping::contains(key)
andMapping::insert_return_size(key, val)
‒ #1224payment-channel
example ‒ #1248 (thanks @kanishkatn!)version
field to ink! metadata ‒ #1313rand-extension
example has been adapted to an updated version of theChainExtension
API ‒ #1356ink_env::pay_with_call!
helper macro for off-chain emulation of sending payments with contract message calls ‒ #1379Result<Self, Error>
as a return type in constructors ‒ #1446Mapping::take()
function allowing to get a value removing it from storage ‒ #1461Mapping
functions - #1492Changed
ink
repository ‒ #1361ink
entrance crate ‒ #1223XXH32
instead ofsha256
for calculating storage keys ‒ #1393LangError
) ‒ #1450LangError
s from constructors ‒ #1504scale-info
requirement to2.3
‒ #1467Mapping::insert(key, val)
andMapping::insert_return_size(key, val)
into one method - #1463__unstable__
wasm import module ‒ #1522return()
type ‒ #1525take_storage
‒ #1568instantiate
methods ‒ #1591CallBuilder
andCreateBuilder
error handling optional ‒ #1602CallBuilder::fire()
method toinvoke()
‒ #1604_checked
codegen call methods withtry_
‒ #1621subxt
dependencies ‒ #1549Fixed
docs
field ‒ #1385WhereClosure
for the generics intostorage_item
‒ #1536 (thanks @xgreenx!)Removed
ecdsa_to_eth_address()
and removeeth_compatibility
crate ‒ #1233wee-alloc
‒ #1403ink_env::random
function ‒ #1442Default
implementation for AccountId ‒ #1255